package edu.biwu.test;

import edu.biwu.sms.PrimaryStduent;
import edu.biwu.sms.StudentManagementSystem02;
import org.junit.Before;
import org.junit.Test;

import java.time.LocalDate;

/*
* 测试学生信息管理系统
* */
public class smsTest01 {
    StudentManagementSystem02 sms = new StudentManagementSystem02();

    /**
     * 初始化学生信息管理系统的数据,为将来测试方法做准备
     */
@Before
    public void initDate(){

    //1.添加学生
    sms.addStudent(new PrimaryStduent("20241316","小新",77,81,
            LocalDate.parse("2013-10-12"),"233434@qq.com"));
    sms.addStudent(new PrimaryStduent("20241327", "小明", 95, 88
            , LocalDate.parse("2014-11-12"), "233534@qq.com"));
    sms.addStudent(new PrimaryStduent("20241333", "花花", 90, 63
            , LocalDate.parse("2023-10-15"), "233434234344"));
    sms.addStudent(new PrimaryStduent("20241335", "天天", 71, 83
            , LocalDate.parse("2024-12-12"), "123123323@qq.com"));
}
    @Test
    public void showAllStudents() {
        sms.showAllStudnet();
    }

    @Test
    public void findStudentById() {
        System.out.println(sms.findStudentById("20241316"));
    }
@Test
public void getAverageScoreBySubject() {
    System.out.println(sms.getAvergeScoreBySubject("语文"));
}

}
